<script setup>
defineProps({
  name: String,
})
</script>

<template>
  <div class="card">
    <div class="title-area">
      <div class="title">
        <slot name="title">{{ name }}</slot>
      </div>
      <div class="title-right">
        <slot name="right" />
      </div>
    </div>
    <div class="content-area">
      <slot name="default" />
    </div>
  </div>
</template>

<style lang="scss" scoped>
.card {
  width: 100%;
  background-size: 100% 100%;
  background-repeat: no-repeat;

  .title-area {
    height: 35px;
    margin-bottom: 15px;
    padding-left: 24px;
    line-height: 35px;
    background-image: url('../../../assets/imgs/card_title_bg.png');
    background-size: 100% 100%;
    display: flex;
    position: relative;

    .title {
      font-size: 26px;
      font-family: YouSheBiaoTiHei;
      font-weight: 400;
      color: #effbff;
      // text-shadow: 0px 1px 3px rgba(6, 17, 29, 0.81);
      background: linear-gradient(
        180deg,
        #e7f0fd 0%,
        #ffffff 50%,
        #bed5f8 100%
      );
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
  }

  .title-right {
    // float: right;
    position: absolute;
    right: 10px;
  }

  .content-area {
    height: calc(100% - 60px);
  }
}
</style>
